package com.simpleframe.views.chart.attribution;


/**
 * 	显示图表主题（最上方）
 * @author Administrator
 *
 */
public class ChartTitle {
	
	/**
	 * 主题名称
	 */
	private String text;
	
	/**
	 * 样式style
	 */
	private ChartTitleStyle style;
	
	public ChartTitle(){
		text = new String();
		style = new ChartTitleStyle();
	}
	
	public ChartTitle(String text,ChartTitleStyle style){
		this.text = text;
		this.style = style;
	}
	
	/**
	 * 将标题以字符串形式返回
	 * @return
	 */
	public String getTitleString(){
		StringBuffer sb = new StringBuffer();
		sb.append(ChartTool.addQuotes("title")+":\n");
		sb.append("\t{\n");
		sb.append("\t"+ChartTool.addQuotes("text")+":");
		sb.append(ChartTool.addQuotes(text)+",\n");
		sb.append(style.getStyleString());
		sb.append("\t},\n");
		return sb.toString();
	}
	
	/**
	 * 默认设定
	 */
	public void DefaultSetting(){
		text = new String();
		style.DefaultSetting();
	}
	
	/**
	 * 以下为属性的get和set方法
	 * @return
	 */
	
	public ChartTitleStyle getStyle() {
		return style;
	}

	public void setStyle(ChartTitleStyle style) {
		this.style = style;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	
	
}
